
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme() + "://" + request.getServerName() + ":" + request.getServerPort() + path;
%>
<html>
<head>
<%--    <base href="<%=basePath %>"/>--%>
    <title>Title</title>
    <script src="<%=basePath %>/js/jquery-2.2.4.min.js"></script>
    <script>
        function test(){
            $.get("./json", function(data){
                console.log(data)
                alert("GET请求结束")
            });
        }
        function test2(){
            $.post("./json", function(data){
                console.log(data)
                alert("POST请求结束")
            });

        }
    </script>
</head>
<body>
<h1>测试案例</h1>
<button onclick="test()">点击发送GET请求</button>
<button onclick="test2()">点击发送POST请求</button>
</body>
</html>
